package com.cfpl.admin_service.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cfpl.admin_service.DTO.PlantLocationDTO;
import com.cfpl.admin_service.VO.AdminPlantLocationList;
import com.cfpl.admin_service.VO.FertilizationDetails;
import com.cfpl.admin_service.VO.PlantLocationVO;
import com.cfpl.admin_service.VO.VegEnvMonitoring;
import com.cfpl.project_common.pojo.PlantingLocation;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
* @author 14720
* @description 针对表【planting_location(种植地点信息表)】的数据库操作Mapper
* @createDate 2023-10-23 10:31:59
* @Entity com.cfpl.project_common.pojo.PlantingLocation
*/
@Mapper
public interface PlantingLocationMapper extends BaseMapper<PlantingLocation> {

    /**
     * 分页查询种植地点信息
     * @param plantLocationDTO 条件对象
     */
    IPage<PlantLocationVO> pageQueryPlantLocation(Page<PlantLocationVO> page,@Param("plantLocationDTO") PlantLocationDTO plantLocationDTO);


    /**
     * 根据种植地点ID查询当前种植地点的所有肥料记录
     * @param plantLocationID 种植地点
     */
    IPage<FertilizationDetails> queryFertilizerByPlantLocationID(Page<FertilizationDetails> page,@Param("plantLocationID") Long plantLocationID);

    /**
     * 查询当前管理员所在种植户的所有种植地点
     * @param adminId 管理员ID
     */
    List<AdminPlantLocationList> queryDicOfPlantLocation(@Param("adminId") Long adminId);
    /**
     * 根据种植地点id查询某一具体果蔬的环境监测数据
     * @param id 种植地点id
     * @return
     */
    List<VegEnvMonitoring> queryVegByEnvMonitoring(@Param("id") Long id);

    /**
     * 根据肥料使用记录查询出种植地点信息
     * @param furId 肥料使用记录
     * @return
     */
    PlantLocationVO queryLocationByFertilizerUseId(@Param("furId") Long furId);
    /**
     * 根据肥料使用记录查询出种植地点信息
     * @param purId 肥料使用记录
     * @return
     */
    PlantLocationVO queryLocationByPesticideUseId(@Param("purId") Long purId);

}




